local zhouyan = fk.CreateSkill {
  name = "lvshi__zhouyan",
}

Fk:loadTranslationTable{
  ["lvshi__zhouyan"] = "舟焰",
  [":lvshi__zhouyan"] = "出牌阶段开始时，你可视为【火攻】；当你造成属性伤害时，可视为使用【铁索连环】。",
  ["#lvshi__zhouyan_fire"] = "舟焰：你可视为【火攻】",
  ["#lvshi__zhouyan_iron"] = "舟焰：你可视为【铁索连环】",
  ["$lvshi__zhouyan1"] = "烈酒洗长刀，屠尽天下敌！",
  ["$lvshi__zhouyan2"] = "怒火燎原，焚尽千里！",
}

zhouyan:addEffect(fk.EventPhaseStart, {
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(zhouyan.name) and player.phase == Player.Play
  end,
  on_cost = function(self, event, target, player, data)
    local room = player.room
    local params = {
      name = "lvshi__fire_attack",
      skill_name = zhouyan.name,
      prompt = "#lvshi__zhouyan_fire",
      skip = true,
    }
    local use = room:askToUseVirtualCard(player, params)
    if use then
      event:setCostData(self, {use = use})
      return true
    end
  end,
  on_use = function(self, event, target, player, data)
    player.room:useCard(event:getCostData(self).use)
  end,
})

zhouyan:addEffect(fk.Damage, {
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(zhouyan.name) and data.damageType ~= fk.NormalDamage
  end,
  on_cost = function(self, event, target, player, data)
    local room = player.room
    local params = {
      name = "iron_chain",
      skill_name = zhouyan.name,
      prompt = "#lvshi__zhouyan_iron",
      skip = true,
    }
    local use = room:askToUseVirtualCard(player, params)
    if use then
      event:setCostData(self, {use = use})
      return true
    end
  end,
  on_use = function(self, event, target, player, data)
    player.room:useCard(event:getCostData(self).use)
  end,
})

return zhouyan